﻿using Common.Enums;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Wallpaper.Models.Entities
{
    [Table("messages")]
    public class Message:BaseEntity
    {



        /// <summary>
        /// 消息类型
        /// 1=审核通过, 2=审核拒绝, 3=系统通知, 4=点赞通知, 5=评论通知
        /// </summary>
        public MessageType MessageType { get; set; }

        /// <summary>
        /// 消息内容
        /// 示例："您的壁纸《星空》已通过审核"
        /// </summary>
        public string Content { get; set; }

        /// <summary>
        /// 发送者ID
        /// null=系统消息, 有值=用户或管理员发送
        /// </summary>
        public string? SenderId { get; set; }

        /// <summary>
        /// 关联的业务ID
        /// 如：壁纸ID等
        /// </summary>
        public string? RelatedId { get; set; }

        /// <summary>
        /// 关联的业务类型
        /// 1=壁纸, 2=评论, 3=订单, 4=用户
        /// </summary>
        public RelatedType RelatedType { get; set; }

        /// <summary>
        /// 消息创建时间
        /// </summary>
        public DateTime CreatedAt { get; set; }

        public ICollection<UserMessage> userMessages { get; set; } = new List<UserMessage>();
    }
}
